package cn.cdeden.system.domain.dto;

//import com.cdyd.ecm.base.CommonDto;
//import com.cdyd.ecm.modules.system.dept.domain.dto.DeptDto;
//import com.cdyd.ecm.modules.system.dept.domain.dto.DeptSmallDto;
//import com.cdyd.ecm.modules.system.other.service.dto.JobSmallDto;
//import com.cdyd.ecm.modules.system.role.domain.dao.RoleSmallDto;
//import com.cdyd.ecm.translation.annotation.Desensitization;
//import com.cdyd.ecm.translation.enums.DesensitionTypeEnum;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Set;

/**
* @author
* @date 2020-09-25
*/
@Data
public class UserDto extends CommonDto implements Serializable {
    private static final long serialVersionUID = 1L;

    private Long id;

//    private Set<RoleSmallDto> roles;
//
//    private Set<JobSmallDto> jobs;

    private DeptSmallDto dept;

//    private List<DeptDto> deptInfo;

    private Long deptId;

    private String username;

    private String nickName;

    private String gender;

    private String phone;

    private String email;

    private String avatarName;

    private String avatarPath;
    /**
     * minio桶名称
     */
    private String minioBucket;
    /**
     * 已用存储空间
     */
    private Long storageUse;
    /**
     * 储存空间
     */
    private Long storageSum;

    /**
     * 储存表id
     */
    private String storageId;

    /**
     * 头像网络地址
     */
    private String storageAvatarPath;

    /**
     * 储存服务器类型
     */
    private String storageType;
    /**
     * 工号
     */

    private String jobNumber;


//    @JSONField(serialize = false)
//    @Desensitization(value = DesensitionTypeEnum.PASSWORD_NULL)
    private String password;

    @Override
    public String toString() {
        return "UserDto{" +
                "username='" + username + '\'' +
                ", nickName='" + nickName + '\'' +
                '}';
    }

    //    @JSONField(serialize = false)
    private Boolean isAdmin;

    private Boolean enabled;

    private Date pwdResetTime;

    private Boolean isLogin;

    private Integer point;


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        UserDto dto = (UserDto) o;
        return Objects.equals(id, dto.id) &&
                Objects.equals(username, dto.username);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, username);
    }



}
